11.What is the time complexity of algorithms designed using Divide and Conquer?
Answer: The time complexity varies depending on the problem, but many Divide and
Conquer algorithms have a time complexity of O(n log n), where n is the size of the
input. This is due to the recursive division and combination steps.
12.How does Divide and Conquer differ from dynamic programming?
Answer: Divide and Conquer breaks a problem into independent subproblems and
solves each subproblem recursively. Dynamic programming, on the other hand, solves
problems by combining solutions to subproblems and storing the results to avoid
redundant computations.
13.What are the advantages of using Divide and Conquer algorithms?
Answer: Divide and Conquer algorithms are often efficient and can be parallelized easily
since they involve independent subproblems. They also help in designing clear, modular
solutions to complex problems.
14.When would you not use Divide and Conquer?
Answer: Divide and Conquer may not be suitable for problems where the division step
results in a large number of subproblems with overlapping solutions. It's also less
effective for problems where the combination step is computationally expensive.
15.How do you determine the base case in a Divide and Conquer algorithm?
Answer: The base case is determined by identifying the smallest subproblem that can
be solved directly without further division. For example, in Merge Sort, the base case is
when the array size is 1.
16.What are some classic algorithms that employ the Divide and Conquer
strategy?
Answer: Merge Sort, Quick Sort, Binary Search, and Strassen's algorithm for matrix
multiplication are also based on the Divide and Conquer approach.
17.Can you explain how Merge Sort works using the Divide and Conquer strategy?